
package com.hlkj.pay.dto.merchant;
/*
 * Hlpay-Plus aggregate payment system.
 * Copyright (c) 2024-2025 Hlpay Team Copyright has the right of final interpretation.
 */

import java.math.BigDecimal;
import java.util.List;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

/**
 * @author HlpayTeam
 * @date 2025/02/18 13:12
 */
@Data
public class RouterConfigDto {

    /**
     * 通道已选的支付方式
     */
    @Schema(description = "appId")
    @NotEmpty(message = "appId 必填")
    private String appId;

    /**
     * 通道已选的支付方式
     */
    @Schema(description = "轮询策略 0：系统默认 1 顺序单个 2 随机多个")
    @NotNull(message = "轮询策略 必填")
    private Integer routerStrategy;

    @Schema(description = "轮询方式 0:机构通道轮询 1:AT通道轮询")
    private Integer routerType;

    @Schema(description = "轮询顺序 1:倒序轮询 0:顺序轮询")
    private Integer routerOrder;

    @Schema(description = "交易失败是否自动切换下一个 1:是 0:否")
    private Integer autoDealFailedNext;

    @Schema(description = "风险推送是否自动切换下一个 1:是 0:否")
    private Integer autoDealRiskNext;

    @Schema(description = "多少分钟成功-对应的分钟值")
    private Integer limitMinutesSuccess;

    @Schema(description = "多少分钟成功-对应的成功率")
    private BigDecimal limitMinutesRateSuccess;

    @Schema(description = "多少分钟交易额-对应的分钟值")
    private Integer limitOrderMinutes;

    @Schema(description = "多少分钟交易额-对应的订单金额")
    private BigDecimal limitOrderAmount;

    @Schema(description = "指定金额对应的通道路由配置")
    private List<RouterConfigOrderAmount> orderAmounts;

    @Data
    public static class RouterConfigOrderAmount {

        @Schema(description = "最小交易额")
        private BigDecimal minOrderAmount;

        @Schema(description = "最大交易额")
        private BigDecimal maxOrderAmount;

        @Schema(description = "交易额指定通道编码")
        private String mchChannelCode;
    }
}
